package com.zf.shuashua.ui.mine;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.vise.xsnow.http.callback.ACallback;
import com.vise.xsnow.http.mode.CacheResult;
import com.zf.shuashua.api.HttpData;
import com.zf.shuashua.bean.FansList;
import com.zf.shuashua.bean.Me;
import com.zf.shuashua.bean.Notificattuonpraise;

public class CommentListVM extends ViewModel {
    private MutableLiveData<Notificattuonpraise> refresh;
    private MutableLiveData<Notificattuonpraise> more;

    public MutableLiveData<Notificattuonpraise> getRefresh() {
        if (refresh == null) {
            refresh = new MutableLiveData<>();
        }
        return refresh;
    }


    public MutableLiveData<Notificattuonpraise> getMore() {
        if (more == null) {
            more = new MutableLiveData<>();
        }
        return more;
    }


    public void getDataRefresh(int page) {
        HttpData.getInstance().getNotificationCommentList(page, new ACallback<Notificattuonpraise>() {
            @Override
            public void onSuccess(Notificattuonpraise data) {
                if (data.isStatus()) {
                    getRefresh().setValue(data);
                }
            }

            @Override
            public void onFail(int errCode, String errMsg) {
                LogUtil.d(errMsg);

            }
        });
    }

    public void getDataMore(int page) {
        HttpData.getInstance().getNotificationCommentList(page, new ACallback<Notificattuonpraise>() {
            @Override
            public void onSuccess(Notificattuonpraise data) {
                if (data.isStatus()) {
                    getMore().setValue(data);
                }
            }

            @Override
            public void onFail(int errCode, String errMsg) {
                LogUtil.d(errMsg);

            }
        });
    }


}